﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Drawing;
using System.Windows.Forms;
using System.Media;

namespace frost
{
    class Meny
    {
        private bool visible;

        private MenyText start = new MenyText("Start game you brave heart", 10, 70);
        private MenyText exit = new MenyText("Exit game you loser", 10, 110);
        private SoundPlayer sound = new SoundPlayer("music/menu1.wav");

        public Meny() 
        {
            visible = true;
        }

        public void Draw(Graphics g)
        {
            if (visible)
            {
                g.DrawString("Meny", new Font("Doktor Terror", 36),
                    Brushes.Red, 160.0f, 10.0f);
                start.Draw(g);
                exit.Draw(g);
            }
        }

        public void mouseHover(Form form, int x, int y)
        {
            start.MouseHover(form, x, y);
            exit.MouseHover(form, x, y);
        }

        public String mouseClicked(Form form, int x, int y)
        {
            if (start.mouseClicked(form, x, y))
                return "start";
            else if (exit.mouseClicked(form, x, y))
                return "exit";

            return "";
        }

        public void show()
        {
            visible = true;
            sound.PlayLooping();
        }

        public void hide()
        {
            visible = false;
            sound.Stop();
        }
    }
}